Stargate Physics 101
by DRMacIver
Summary: The diary of one of the Ancients responsible for designing the original Stargates is discovered. Some things that were previously thought to be fundamental features of wormhole physics turn out not to be. Tantalising new information about the Furlings is discovered. This is primarily a comedy about the importance of software testing and mass-extinction.


Daniel was sitting hunched over some notes and an Ancient reading device when Jack came in.

"Hey Daniel, briefing was half an hour ago. Where were you?"

Daniel looked up startled. "Oh! Sorry, I completely lost track of the time. I was working on translating these texts we found on P7X-909. They're _fascinating_.".

"More fascinating than figuring out what the Goa'uld are up to now?"

"Yes, actually. It seems to be the diary of one of the Ancients who developed the first Stargates. It's quite fragmented – a lot got lost in the last hundred thousand years – but there's some really big stuff in here. This could completely change the way we think about how the gates work."

"Cool! Have you talked to Sam about it yet?"

"Not… yet."

"Well why not? This is totally her thing!"

"Well, I don't think she's going to like it."

* * *

I was banging my head on my desk when Clodia came in.

"Oh dear, Gaius. Is it really that bad?"

"Yes", I moaned. "Everything is terrible. I'm so fired."

"Oh come on. What's wrong?"

I raised myself up, hoping I didn't look as bad as I felt. I think I'd slept last night? I'm not really sure.

"So I'm working on this project Amelius gave me…"

"Oh."

Yeah, that's entirely the correct reaction to that sentence. Amelius has this tendency to hand you brilliant ideas which he insists just need a little bit of work to finish off. It then takes you six years to prove the idea is fundamentally impossible or turns out to be strictly worse than something that already exists. He genuinely is a genius, but he's not what you might call practically minded.

Unfortunately he's got major pull with the research council – partly due to his work on the intergalactic drive, partly because of his family – so if he gives you a project to work on you're mostly stuck with it.

"He's got this new idea for interstellar travel. It's revolutionary really – you set up these rings, connect a stable wormhole between them and then just walk through. Interstellar trips that we'd do in weeks can be accomplished as easily as walking across the room."

"But it doesn't work?"

"Oh no, it works! It's really a very elegant design. He's worked out a way to set up a stable wormhole with remarkably little energy and equipment. It's easily a generation or more ahead of the best attempt anyone else has made, and you can even do it without destroying a star!"

We shared a grimace at the memory of the team responsible for _that_ debacle.

"So what's the problem?"

"Well, I mean, it's great if you want to send a stream of highly charged particles to the other gate, have them arrive at precisely the speed they set out at, and basically nuke the destination with the velocity difference. If you want to be not torn apart by tidal forces and leave the destination mostly intact you're basically out of luck."

"Ah."

"So I've been trying to figure out a way to get the tidal forces smoothed out, but the problem is the gate size – I could do it if I could build a gate about three hundred meters across and we didn't have to worry about the velocity differences. I think. The details look like they'd still be tricky but it would probably work. A couple meters across and suitable for people though? It just can't happen!"

"That would still be pretty useful if you put it in space."

"Yeah, but it's not at all the spec I've been asked to build."

"Hmm."

She put her hand to her face and furrowed her brow in a thoughtful expression.

"Have you tried sending a ring stream through?"

"What?"

"Well, the matter stream from a ring transport mostly _is_ a stream of highly charged particles, and the receiver system is basically designed to buffer a massive amount of energy so it doesn't explode if you try to use it from a moving ship. The tolerances in a standard ring are all off, but it's only by like an order of magnitude. You could probably soup up the buffers then bleed off any extra energy back through the wormhole to balance the scales on the other end."

I banged my head against the desk again.

"No! Of _course_ I didn't think to use the powerful new system I have for sending charged particles to use the well established system we have for transmitting people as charged particles to transmit people. Why would I do _that_? Gah. Thanks Clodia. You're brilliant."

She really is. Amelius is smarter than the rest of our group put together, but when it comes to lateral thinking and the sort of problem solving you need to actually get things done there's basically Clodia and then there's everyone else. Projects with her on it tend to have three or four times the success rate as projects without.

She shrugged. "It's no big deal. You were too close to the problem and needed an extra pair of eyes. Anyway it might not work – there's a ton of details to figure out."

She was right. Rings are short distance for a reason – they're really not very good at handling bad signals. I once saw someone try to use rings in a lightning storm. They survived, but it was pretty touch and go for a while.

I grasped on to a possible lifeline.

"Still, you've been a huge help already. Would you maybe like to work on the project with me? I could really use an extra pair of hands, and you'd be amazing for making this work."

"Sure. The council axed the project I was helping Janus with, so I'm looking for a new thing to do. This sounds neat."

Maybe I wasn't going to be fired after all.

* * *

Clodia and I work really well as a team. She's better than me in almost every regard, but I'm really good at grinding through a problem and just making the accursed thing work when you give me something that is actually solvable.

She was the one who got the error correcting codes that let us send a stable signal down a wormhole, but I was the one that made the maintenance protocols that kept the wormhole open properly and made sure the signal actually got there. She's the one who figured out the dialling protocols and how to do gravitational attachment to a planet with a gate but… actually no, that one was mostly her. I did help with the code review though.

I'm pleased to say that I was the one who figured out how to convert a ring's instantaneous disassembly protocol to a standing wave which would buffer objects until they were ready to send. I bounced ideas off her for the whole object recognition algorithm, but the one we ended up going with was mine.

It took us about six months before we got the first "Stargate" (our code name for the project. I know, it sounds ridiculous. We'll come up with something better when we release) working. You couldn't send people through, but as a high bandwidth communications channel it was a _lot_ better than the state of the art. If that was the best thing that came out of the project we'd already be doing pretty well.

But of course it wasn't even _close_ to the spec Amelius had given us to build.

We shipped one of them off to the nearest inhabited planet in another star system – horrible hellhole of a place called Abydos. They've got lots of raw mineral resources there and plenty of autofactory capacity, so we can just send them the plans for updated designs through the Stargate and ask them to build it for us rather than keeping shipping new prototypes out there and waiting several days to try it out.

* * *

The first physical object we sent through to Abydos was an amphora of really strong brandy (I know _I'd_ need a drink if I lived there).

We quickly realised that maybe this wasn't such a good idea. Fortunately the receiving room wasn't flammable, and the burns were easily treatable.

The second thing we sent through the Stargate once we worked out what we'd done wrong was a bunch of flowers and a hand written apology note.

* * *

It took about two years from the start of the project before we were confident enough to send people through. We couldn't ask anyone else to risk it, both as a matter of pride and because they would have told us to go to hell, and we didn't feel comfortable with only one of us being at risk, so we stepped through together.

I still have nightmares when I think about how early in the project we risked this. Some of the bugs we found in the system later could have killed us or worse.

But it worked. We stepped through, a little shaken but entirely intact. I'm not too proud to admit that the noise I emitted was something a bit like "Squee!". We did a little dance, hugged, and generally felt _so_ smug.

We felt less smug when we realised we hadn't figured out return coordinates to get back home, and that all the notes and equipment we needed to do so were back on Earth.

* * *

It only takes three days to get from Abydos to Earth. Unfortunately there's only one ship that does the route (a giant cargo hauling vessel), and it only goes once a week. We'd just missed the last one, so this gave us 10 days to kill.

The break was probably good for us, but we were going stir crazy by the end.

We even had a brief fling, mostly out of boredom, but decided that it wasn't a good idea and we made much better coworkers than lovers. Clodia mostly prefers other women, and my primary is getting increasingly annoyed at how much of my time this project is taking up anyway.

Anyway, we made it back to Earth eventually.

* * *

It took us about another year of ironing out kinks and figuring out design protocols, but we got a small prototype Stargate network up through all of the thirty nine core systems – they weren't really ready to use, but with the autofactories it was easy enough to build them and it was mostly a software problem now so we figured we might as well get every planet hooked up.

The coordinate calculations were pretty hairy, so we just hard-coded each location into the Stargates for now. It shouldn't be hard to extend properly later.

* * *

We thought things were going pretty well. Then the Earth Stargate exploded.

I was far enough away that I got out of it mostly intact, just some scrapes and bruises. Clodia was less lucky and lost her left arm and had to spend a few days in a healing pod to regrow it. She was fine, but _incredibly_ irritable for a few months – those things really mess with your head, even if the major trauma wasn't enough.

After she was out of the pod we did a close reading of the error logs and Stargate source code to figure out what went wrong.

Apparently if your wormhole passes too close to a sun _and_ the relative velocities are too great _and_ you try to close the Stargate before a certain amount of time has passed (the amount depends on the amount of mass you sent through) _and_ the essentially arbitrary iteration order in the cleanup code for the correction channel shutdown happens in just the wrong way _then_ you vent the spare energy from the transfer into the control crystal instead of the buffer. This will certainly break it, but if you're unlucky enough to have a certain type of crystal that was popular when we were designing that section of the interface then you find out that the designers skimped on safety protocols and you basically have a crystal bomb on your hands.

On the way we found three other bugs. One would have caused an error mid-transit and you would probably have lost the passengers, one would have inverted the passengers at the molecular level (they might not even have noticed until they wondered why they could no longer digest their food), and the final one would have turned the receiving Stargate into a Naquadah bomb capable of removing a sizable chunk of the planet it was on.

Obviously we shut down the entire Stargate network at that point.

* * *

We decided to get in a third pair of eyes to help us turn the death traps we'd built into a working transport network. Temit had just come off a project and we knew they would be perfect for this sort of thing, so we went to them on hands and knees and asked if they'd help us out.

I'm given to understand that glowing eyes are a sign of excitement in a Furling and the fact that Temit looked like they would eat me was in fact more a product of my cultural expectations around large furry animals with really very unneccessarily large teeth than it is a correct inference about Furling body language.

At any rate, they said yes.

No, I don't know Temit's gender. You don't ask with a Furling. To the best of my knowledge a Furling has never attacked an Alteran, but questions about gender have brought them awfully close. Temit is a they and that's that.

Anyway, why is there a Furling working in our research group?

Well, Temit _loves_ Alteran technology. Specifically they love breaking it. I've asked them what's up with this and they said that Furling technology is too packlis for their taste. I asked them what that means and they said it made them want to volb a Pnernit. I asked them what _that_ means and after about half an hour of dancing around untranslateable words I eventually concluded that what they meant was that Furling technology has been so thoroughly overdesigned and tested for bugs that you basically can't find anything wrong with it, and that they found this really boring. Temit grudglingly agreed that this was probably about as close to an accurate translation as we were going to get but that it didn't properly account for the way the lack of olemic zebbed their sense of fnarin.

* * *

I'm still very bad at reading Temit's body language, but I'm almost certain the way their fur bristled when they did their first reading of the Stargate source code was a bad sign.

* * *

The first question that Temit asked me is what happens when someone tries to go through an incoming Stargate wormhole.

"Well, they get stored in the out-buffer same as if it were an outgoing wormhole I guess."

"How do they leave the buffer?"

"Uh, I guess they don't. Hmm. That's bad isn't it?"

"Why isn't the wormhole bidirectional?"

"You can't send a matter stream both ways. They interfere. Our early versions let you go both ways but even the air coming through from the other side is enough to basically destroy the coherence."

"What happens to the matter in the out-buffer in the other end when the wormhole shuts down?"

"Well, hmm. I think it gets shunted into the shared energy pool same as normal, but I'm not sure. Let me check the code."

I checked the code.

"Oh, uh. I think that might cause the Stargate to explode."

I got really tired of saying that within about three days of working with Temit.

* * *

We solved the out-buffer problem causing the Stargate to explode in the end, but we simply couldn't come up with a coherent way of dealing with matter in it. In the end we just settled on storing what we could of it and venting the rest into the shared energy pool of the gate network. Temit grumbled about this, but I did some calculations and concluded that you would have to send about a kiloton of matter at more than 80% of the speed of light through the back buffer of an incoming wormhole before it would overwhelm the gate network and cause all the Stargates to explode.

Temit asked me what would happen if you dropped a gate with an incoming wormhole into a star. I asked them if they thought anyone was really likely to be so bloody stupid as to drop a _Stargate_ into a _star_. Temit asked me if I thought anyone was likely to be so bloody stupid as to deploy a system capable of destroying every inhabited world if someone merely did something unexpected to it.

I did the calculations and concluded that OK yes dropping an incoming wormhole into a star was probably going to do quite bad things. I put in a cut-off so that if you tried to put too much energy into an incoming wormhole only _this_ gate would explode.

* * *

Having Temit on the team made Clodia and I really up our game. We wanted to find problems before they did.

I was the one who figured out that putting a Stargate against an solid surface with not enough space to clear things out then it would cause the _dialling_ gate to explode. I put in a system that would clear anything out of the front of the gate when there was an incoming wormhole (with the back-buffer problem it was already well established that the only safe policy is to stay well away from incoming wormholes, so this seemed safe enough).

Temit asked me what happened if the wormhole was blocked only after it had properly been formed and the blast had subsided. I said that I didn't think that was very likely and they gave me a look.

Grudgingly, I redesigned the system so that after the gate had tried and failed to eject an object it would explicitly reclaim it into the back buffer. I kept the clearing blast in anyway because I'd spent a lot of time writing that code and didn't want to throw it away. Besides, it might be useful.

* * *

The research council were getting increasingly impatient with the project and wanted us to deploy it – frankly I think they were bored of taking ships to get to the council meetings. So we were running around trying to nail down the final bugs in the design so we could ship on time when Clodia came to me with a worried look on her face.

"How long can a wormhole stay open for?"

"Only 15 minutes, right? That's how long the power storage unit can keep it fed for, and then it takes time to recharge."

"So why has the test wormhole to Taonas been open for 23 minutes?"

"Uh."

We shut down the wormhole and sat down to try to figure it out. Eventually we realised what had to be going on.

We've got this whole giant shared energy pool we've been dumping every bit of excess energy from the gates into. It's a pretty clever design actually (Clodia's, obviously). We more or less get energy storage for free out of the space-time stress of the secondary wormholes we use as a communication network between the gates. You can't extract energy out of it _that_ easily, but between the power flow from that and the main power source you could _nearly_ keep up with the wormhole's drain rate. You couldn't keep a wormhole open indefinitely, but it could easily stretch to seven or eight hours of active wormhole time.

We decided we should test this and see how long we could keep the gate open.

At this point Temit stepped in and informed us in no uncertain terms that when testing this we would be employing the proper Stargate test procedure that they had implemented for us to use on all new gate designs. That is, we would be putting the Stargate in orbit of a planet that was currently on the opposite side of the sun, surround the gate with a forcefield, and operate it remotely from a suitably safe distance in a hyperdrive capable craft.

Clodia and I argued that we really weren't doing anything different from what we normally did and this all seemed a lot of bother for just some minor stress testing.

Temit is really much wiser about this sort of thing than we are.

Anyway, we set up the test gate in orbit of Tellus (we'd normally use Mars, but its orbit had come too close to Earth recently, so we went one planet further out) and opened up a gate to one of the uninhabited systems we used for test destinations.

After 38 minutes the wormhole started to destabilise – at first nothing too bad, just a rapidly dropping transfer rate, but after an additional 17 minutes we started to get energy flowing backwards out of the wormhole, and the gravitational stress inside it began to grow at a really rather alarming rate.

We tried to shut it down, but the control crystals had already blown. The Stargate network was still feeding the wormhole, but it had long ago lost any chance of controlling it.

Fortunately the gravitational effects destabilised the orbit and the gate crashed into Tellus, which absorbed most of the energy the gate put out before it finally shut down. So that's the good news. The bad news is that we're going to have to find another planet to use for testing next time.

We eventually tracked this down to some of the stabilisation algorithms – they work fine within the intended time frames, but there's an inefficiency in them that gets worse the longer the wormhole is open and eventually they can't keep up with the shifts. This _would_ be fine but when they get too far out of sync with the shifts they start to exaggerate rather than dampen them down. _This_ would be fine, if the extra power weren't coming in through a secondary wormhole network (it's much smaller, doesn't need to handle actual matter, and uses a different algorithm which is why it doesn't have this problem) which then gets linked into the primary wormhole network.

It turns out that during all the testing we'd done of the system we'd put quite a lot of energy into that secondary network.

If we'd had time to take the code for the stabilisation that I'd written back in the first six months of the project apart and do it all again from scratch I'm pretty sure we could have fixed the problem, but with the pressure to deploy this thing I ended up just putting in a hard cutoff so that the gate would shut down as soon as it started to destabilise.

I'm much better at reading Furling body language now, which is why I learned that there _are_ things that upset Temit more than asking them what their gender is.

* * *

The council have decided to deploy the gate network anyway, despite our requests that we would really like another six months of field testing.

In response, Temit announced that they intend to return home to the Furling worlds and strongly recommend that travel to Alteran worlds be restricted. They said that while fnarin is all very well they didn't really want to be anywhere near a dangerously irresponsible species who were probably going to get themselves killed through their poor safety control procedures.

They did leave us with a list of questions, including:

1\. What happens when two Stargates try to dial in at exactly the same time?  
2\. What happens when you rotate a Stargate at high velocity and dial out? What happens if you dial in to such a gate? What if the other gate is also rotating?  
3\. What happens when a Stargate gets too near to a black hole?  
4\. What happens if you drop an outgoing gate into the sun?  
5\. What happens if you take an outgoing wormhole out of orbit of the planet it's on and then try to dial in when there's a second gate on the planet?  
6\. How do you protect against malicious code in the gate network?  
7\. What happens when two gates are travelling at a significant fraction of the speed of light with respect to eachother?  
8\. What happens if you try to engage a hyperdrive while trying to travel through a gate?

The full list is… longer. I was rather afraid I knew the answers to some of them.

Anyway, I'm mostly not too worried. Most of these scenarios are _really_ hard to hit, and we'll have plenty of time to work out the issues and the quirks of the behaviour in the next version of the software.


End file.
